System and Method for Driving LED

ABSTRACT

A system and method for driving one or more LEDs by regulating their brightness by controlling the LEDs&#39; average current or voltage. The system includes a switching power converter and an integrated digital regulator with at least one of electrical, thermal, and optical feedbacks. The regulator is constructed as a PI or PID controller for continuous mode of operation of the power converter. Current is provided through an inductor and a power switch during an on time of the power switch. The ampseconds of the inductor are measured at an off time and compared with a periodic ramp signal. A set reference signal is also compared with the periodic ramp signal. Based on the comparisons between the ramp signal, the measured ampseconds, and the reference signal, a control signal is generated to regulate the peak current through the power switch.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application is a division of U.S. patent application Ser. No.13/558,237, filed Jul. 25, 2012, which is a division of U.S. patentapplication Ser. No. 12/497,682, filed Jul. 5, 2009 (now U.S. Pat. No.8,232,735), which is a division of U.S. patent application Ser. No.11/838,186, filed Aug. 13, 2007 (now U.S. Pat. No. 7,583,035), which isa division of U.S. patent application Ser. No. 11/142,859, filed May 31,2005 (now U.S. Pat. No. 7,276,861), which claims the benefit of U.S.Provisional Application No. 60/611,539, filed Sep. 21, 2004. U.S. patentapplication Ser. No. 12/497,682, filed Jul. 5, 2009 (now U.S. Pat. No.8,232,735), is also a division of U.S. patent application Ser. No.11/838,208, filed Aug. 13, 2007 (now U.S. Pat. No. 7,710,047), which isa continuation of U.S. patent application Ser. No. 11/142,859, filed May31, 2005 (now U.S. Pat. No. 7,276,861), which claims the benefit of U.S.Provisional Application No. 60/611,539, filed Sep. 21, 2004. Each of thedisclosures of said applications are incorporated by reference herein intheir entirety.

BACKGROUND

Known in the industry are a few drivers for light emitting diodes(“LEDs”), like charge pumps with the multi-output current mirror fromNational Semiconductor. These drivers cannot economically boost inputvoltage more than 1.5 to 2 times and therefore call for parallelcircuits for identical driving of multiple LEDs. That makes thesedrivers large and expensive. Also desired in this case is a linearcurrent regulator in each channel which compromises the efficiency of anLED driver.

Also known is an inductor based boost converter, like LT 1932 fromLinear Technology™ or NTC5006 from On-Semiconductor™. The mostfrequently used topology is a current mode regulator with the rampcompensation of PWM circuit. Such a current mode regulator needsrelatively many functional circuits and still exhibit stability problemswhen it is used in the continuous current mode with the duty ratio over50%. As an attempt to solve these problems, the designers introducedconstant off time boost converter or hysteric pulse train booster. Whilethey addressed the problem of stability, hysteretic pulse trainconverters exhibit difficulties with meeting EMC and high efficiencyrequirements.

U.S. Pat. Nos. 6,515,434 and 6,747,420 provide some solutions outsideoriginal power converter stages, focusing on additional feedbacks andcircuits, which eventually make the driver even larger.

To overcome the problems listed above, a process and system is disclosedfor controlling a switching power converter, constructed and arrangedfor supplying power to one or a plurality of LEDs to reduce the size andcost of LED driver. Also disclosed is a controller which is stableregardless of the current through the LED. Further disclosed is a highefficiency LED driver with a reliable protection of driver componentsand input battery from discharging at the damaged output.

SUMMARY

An LED, having a diode-type volt amp characteristic, presents a verydifficult load for voltage type regulators. That is why all up to dateLED drivers are constructed as a regulated current source, including thereferenced prior art in FIG. 1. The current regulator in FIG. 1 includesa feedback signal, which is created as a voltage signal proportional tothe average LED current. In practically all switching LED drivers,current through an LED is a stream of high frequency pulses, and theabove-described feedback introduces phase delays, makes for poor dynamicresponse, and prevents a regulator from acting within one switchingcycle.

DESCRIPTION OF THE DRAWINGS

The teachings of the present disclosure can be readily understood byconsidering the following detailed description in conjunction with theaccompanying drawings.

FIG. 1 is a prior art current regulator according to U.S. Pat. No.6,747,420 B2;

FIG. 2 is a system for driving one or a plurality of LEDs;

FIG. 3 is a step up converter for driving one or a plurality of LEDs;

FIG. 4 is a diagram illustrating current waveforms of a switchingconverter according to one embodiment of the present disclosure;

FIG. 5 is a block diagram of a regulator with an integrator according toan embodiment of the invention at constant switching frequency;

FIG. 5A is a block diagram of a regulator with an integrator accordingto an embodiment of the invention at a variable switching frequency;

FIG. 6 is a diagram illustrating signal waveforms in a regulator with anintegrator;

FIG. 7 is a diagram of a nonlinear control voltage dependent on thecurrent error Iset-Is;

FIG. 8 is a block diagram of a regulator with an integrator according toanother embodiment of the present disclosure;

FIG. 9 is a block diagram of a regulator according to the sliding modecontrol of the present disclosure;

FIG. 9A is a diagram illustrating an algorithm of the sliding modecontrol of the present disclosure;

FIG. 9B is a block diagram of a regulator according to a sliding modecontrol with a passive LED current filter;

FIG. 10 is a block diagram of a sliding mode control regulator accordingto another embodiment of the present disclosure;

FIG. 11 is a block diagram of a PI regulator with Ipset output accordingto the present disclosure;

FIG. 11A is a block diagram of a PI regulator with Ton output accordingto the present disclosure;

FIG. 12 is a diagram illustrating signal waveforms of an errorgenerator;

FIG. 13 is a block diagram of a power converter with protection againsta short circuit;

FIG. 14 is a block diagram of a power converter with protection againsta short circuit and overvoltage; and

FIG. 15 is a block diagram of a power converter driving strings of R-G-BLEDs with current regulators.

DETAILED DESCRIPTION

The embodiments of the present disclosure will be described below withreference to the accompanying drawings. Like reference numerals are usedfor like elements in the accompanying drawings.

FIG. 2 is a system 1 for driving one or a plurality of LEDs, accordingto one embodiment of the present disclosure. The system 1 includes anenergy source 2 and a switching power converter 3 driving a string ofLEDs 4. The performance of the LEDs is measured by electrical andthermal sensors (not shown separately from LEDs 4) and a photosensor 5.These sensors generate electrical, thermal, and optical feedbackchannels coupled with a regulator 6 controlling the output of the powerconverter 3. The regulator 6, according to one embodiment of the presentdisclosure, can have as a minimum a single electrical feedback. Yet, itmay use additional thermal and optical feedback channels for enhancedperformance, according to another embodiment of the present disclosure.The energy source 2 is an AC/DC converter, connected to the AC utilityline (not shown) in one embodiment of the present disclosure. The energysource 2 is a DC/DC converter connected to any DC voltage source (notshown) according to another embodiment of the present disclosure. Yet inanother embodiment of the present disclosure the energy source 2 is abattery, which may be of a variety of technologies (like solar panels orelectrical rechargeable or non-rechargeable batteries of varieties ofchemistries). The regulator 6 is constructed as analog, mixed signal, ordigital functional block according to embodiments of the presentdisclosure. A fixed high-frequency oscillator (not shown) is supplyingclock signal to the regulator 6.

The power converter in FIG. 2 is a step up (if the source voltage shouldbe boosted) or a step down (if the source voltage should be decreased)switching converter, such as inductor-based boost, or buck boosttopology according to the embodiments of the disclosure. FIG. 3 is asystem 1 with a boost power converter 3 comprising a battery 2, inductor7, a semiconductor power switch 8, a rectifier 9, regulator 6, an Ippeak current sensor 13, an LEDs current sensor 10, a voltage sensor 11and 12, a string of LEDs 4, and an oscillator 30, according to oneembodiment of the present disclosure. The performance of the boostconverter 3 is illustrated by FIG. 4. The power switch 8 is turned onand off by the regulator 6, storing energy in the inductor 7 at on timeand discharging it into the LEDs 4 at off time. Current in the inductor7 is shown in FIG. 4 as continuous. However it may also bediscontinuous, depending on the mode of operations (not shown). Thecurrent through LEDs 4 is marked as Is and represents a stream ofhigh-frequency pulses, shaped during off time of the converter 3. Whenthe power switch 8 is closed, energy is stored in the inductor 7. Theinductor current increases to a value of I_(P1), that is determined bythe on time of the power switch, the inductor value and battery voltage.When the power switch 8 is open, the energy in the inductor 7 isdelivered to the load. The inductor current during this time decreasesto a value of I_(P2), which is dependent on the off time of the powerswitch.

Assuming ideal components, the relationship between input voltage andother parameters can be defined by the following equation:

V _(IN) =L(I _(P1) −I _(P2))/T _(ON),  (1)

Where:

V_(IN)=DC input voltage,

I_(P1)=peak current in the inductor at the end of charging,

I_(P2)=peak current in the inductor at the beginning of the inductorcharging,

T_(ON)=on time, and

L=inductance.

When the power switch 8 is open, the inductor 7 discharges energy intothe output load. The output voltage is defined by the followingequation:

−V _(IN) +V _(OUT) =L(I _(P1) −I _(P2))/T _(OFF),  (2)

Where:

V_(OUT)=DC output voltage, and

T_(OFF)=off time.

Assuming average LEDs current:

I _(AVG) −V _(OUT) /R _(D)  (3)

RD=equivalent DC resistance of the LEDs is assumed to be known.

I _(AVG)=(I _(P1) +I _(P2))T _(OFF)/2(T _(ON) +T _(OFF))  (4)

and assuming a steady process,

V _(IN) *T _(ON)=(−V _(IN) +I _(AVG) *R _(D))*T _(OFF)  (5)

The on time can be determined by the following equation:

T _(ON)=(−V _(IN) +I _(AVG) *R _(D))*T _(OFF) /V _(IN)  (6)

The frequency of the output is equivalent to:

f=1/(T _(ON) +T _(OFF))  (7)

Solving equations (1) through (6),

I _(P1)=(V _(OUT) −V _(IN))T _(OFF)/2L+I _(AVG)(V _(OUT) /V _(IN))  (8)

I _(P2)=(V _(OUT) −V _(IN))T _(OFF)/2L−I _(AVG)(V _(OUT) /V _(IN))  (9)

FIG. 5 is a regulator 6, according to one embodiment of the presentdisclosure, and comprising input to LEDs current feedback Is (or voltageVs), an integrator 14 with a reset switch 15, an LEDs current comparator16, digital logic 17, an A/D converter 18, an Ip peak current comparator19, and a buffer 20 driving the power switch 8. The followingtheoretical analysis represents a synthesis of the process of driving ofa nonlinear load (like a single or multiple strings of LEDs) from acurrent source, regulating averaged current or voltage at the load. FIG.6 illustrates the LEDs 4 current and the inductor 7 current. Theintegrator 14 integrates LED 4 current signal, shown as a waveform forintegrator 14 in FIG. 6. The integral of the LEDs 4 current during theoff time:

$\begin{matrix}\begin{matrix}{{{\int_{0}}^{Toff}{{Is}\ {t}}} = {\int_{0}^{Toff}{( {{{Ip}\; 1} - {( {{{Ip}\; 1} - {{Ip}\; 2}} )\frac{t}{Toff}}} )\ {t}}}} \\{= {( {{{Ip}\; 1} - {{Ip}\; 2}} )\frac{Toff}{2}}}\end{matrix} & (10)\end{matrix}$

According to the waveform for LEDs 4 in FIG. 6 the average LEDs currentis equal to:

$\begin{matrix}{{Iavg} = {( {{{Ip}\; 1} + {{Ip}\; 2}} )\frac{Toff}{2\; T}}} & (11)\end{matrix}$

-   -   T=cycle time

Comparing Iavg in equation (11) and integral (10) we can make aconclusion that the integral (10) would be (a) proportional to theaverage LEDs current if cycle time T is constant and (b) equal to theaverage LEDs current if the integrated value is divided by cycle time T.In one embodiment of the present disclosure, the process of driving LEDswith the constant switching frequency is based on steps of storingenergy in the inductor during on time of the power switch, dischargingit into LEDs during off time of the power switch, measuring ampsecondsof said inductive element at off time and adjusting peak current throughthe said switch to keep said off time ampseconds in the inductor duringoff time constant and proportional to the set average current throughLEDs. Thus, the disclosure is using generation of the off timeampseconds signal in the inductor as one switching cycle feedback. Theampseconds are measured by integrating discharging inductor 7 currentduring off time, sampling the integrator 14 at the end of off time, andresetting the integrator 14 during on time.

Expression (10) is a theoretical interpretation of the method: to keepLED brightness constant at constant frequency, the input voltage changesare compensated in such a manner that the inductor off time ampsecondsand average current of the LED remains constant (or regulated). Themethod is illustrated on FIG. 5 and FIG. 6. The integrator 14 startsintegrating the LED current at the beginning of off time. At the end ofthe cycle the digital logic 17 samples the output of the integrator 14.At the same time the power switch 8 is turned on. Sampled voltage (V14)from integrator 14 is compared with the Iset signal. If V14<Iset thenlogic adds a ΔVc signal to the switch comparator 19 reference voltageVc=Vc+ΔVc. When Ip reaches its set value by Vc the comparator 19 turnsoff the power switch. If V14>Iset then Vc=Vc−ΔVc and new peak currentwill be reduced. During on time the output of the integrator 14 isshorted by the reset switch 15. In one embodiment of the disclosure,updating of the control voltage Vc is linear:

Iset=V14 Vc(n+1)=Vcn

Iset>V14 Vc(n+1)=Vcn−ΔVc

Iset<V14 Vc(n+1)=VcnT+ΔVc

Thus regulator 6 in FIG. 5 provides hysteretic current mode control ofLED current with a dynamic response within one switching cycle. Innormal conditions, the output current will be hysteretically adjusted atthe set level. That makes the controller inherently stable and does notrequire compensation. At transient (change of Vin, temperature or LEDperformance, including shorted or open device) the controller willadjust primary peak current to have LED current equal to Iset.

In yet another embodiment of the present disclosure, the control voltageΔVc is adjusted based on function presented in FIG. 7, inverselyproportional to a difference between set and measured signals.

In yet another embodiment of the present disclosure, shown in FIG. 5A,the off time is kept constant by digital logic 17 and cycle time isvariable, defined by the controller (regulator) 6. In this embodiment, adivider by cycle time 14A is added to the output of integrator 14, andthe output of the divider 14A is connected to the positive terminal ofLED comparator 16.

Different combinations of the circuits may be used to drive one ormultiple of LEDs according to said method. A digital implementation ofthe same regulator 6 is shown on FIG. 8, where 21 is a digital logic,combining various functional blocks of FIG. 5.

Traditionally, in peak current mode control regulation, a user specifiesa reference current, and then the power switch switches off when theinductor current rises to this reference current (minus an appropriateslope compensation to maintain global stability). However, in pulsedcurrent averaging, we propose to regulate differently: we propose todirectly regulate the length of power switch on time (T_(on)) in orderto create the desired peak value I_(p). We then relate this peak valueto the load output current's average value. Hence, load currentregulation becomes possible. Since LEDs call for current regulationinstead of voltage regulation, this makes pulsed current averaging aprime candidate for its application. Our goal is now to relate thecontrol variable T_(on) to the output current through the load. Peakcurrent in the inductor, assuming discontinuous operation:

$\begin{matrix}{{Ip} = \frac{VinTon}{L}} & (12)\end{matrix}$

Ip=Peak current in the inductor 7, and

Vin=Input voltage.

Average current in the load:

$\begin{matrix}{{Iav} = \frac{IpToff}{2\; T}} & (13)\end{matrix}$

Volt second balance of the inductor:

Vin*Ton=(Vout−Vin)Toff,  (14)

Where:

Vout=Output average voltage.

Combining equations (12) to (14) and solving it to T_(on) will getdependence of average current from the variable T_(on):

$\begin{matrix}{{Iav} = {{Ton}\frac{V_{i\; n}^{2}}{2\; {LVout}}}} & (15)\end{matrix}$

The conclusion of this simplified analysis is that the on time of thepower switch is proportional to the output current. Thus, by adjustingT_(on), the output current through the load will be changed in a linearrelation. Notice, also, that the output current is inverselyproportional to the output voltage in this relation. Therefore, insystems in which output voltage may quickly deviate from a desiredvalue, this method may need to utilize advanced nonlinear controllersfor regulation. This has compelled researchers to utilizemultiplications in controllers to adjust T_(on). That is, an innercurrent loop in power factor correction circuits often makesT_(on)∝kV_(OUT)(I_(Ref)−I_(L)). This is obviously a more complicated andnonlinear controller because it uses digital multiplication, as well asan additional outer voltage loop (usually PI controller) to helpregulate the voltage.

Instead of a complicated approach to control, we propose to use therelation of T_(on) to I_(av) in a hysteretic/sliding mode scheme thatsimplifies implementations and may not use external A/D converters. Theidea is to increase or decrease T_(on) by discrete pulses in order tocontrol the average current being delivered to a load: hence, theterminology pulse average current control. Conventional methods forcontrolling the current output of commercially available integratedcircuits for LEDs drivers uses a combination of analog operationalamplifiers and compensation ramp generators. We have come up with adigital control approach to controlling output currents that does notuse these additional parts. This is not a DSP engine with softwareoverhead; this is an optimized digital core that uses a sliding controlalgorithm to determine the amount of power to transfer to the outputusing a boundary/sliding mode control criteria.

To demonstrate the proposed regulation approach according to oneembodiment of the disclosure and show its potential, we describe thepulsed average current regulation using a simple hysteretic controller.The pulse average current regulation comprises the following steps, seeFIG. 3 and FIG. 9: oscillator turns on switch 8, and current startsbuilding in the inductor 7; at the same time Time, registerT_(on)+/−Δt_(on) is set with the count of time T_(on), when t=T_(on)switch 8 is turned off;

Inductor 7 starts to discharge (it is assumed that the conversionprocess is discontinuous);

LED current is sensed and integrated by integrator 14 for a period ofoff time T_(off);

the integrated value is sampled by digital logic 25 at the end of cycletime and integrator 14 is reset by switch 15;

sampled integrated value is divided in divider 14A by cycle time T andit is compared with the set value of the LED current Iset

-   -   If Is<Iset The controller selects to change T_(on) by +Δt_(on)    -   If Is>Iset The controller selects to change T_(on) by −Δt_(on)

on time in the Time register 25A is adjusted by +Δt_(on) or −Δt_(on);and

new cycle starts.

If the system detects more than two consecutive cycles with the samesign of Δt_(on) increment, the system may use look-up tables to adjustthese increments to accelerate convergence of measured Is signal andreference Iset.

A simplified sliding mode regulator is presented in FIG. 9B. Instead ofan active integrator 14 with reset, a passive R-C filter (resistor) 22and (capacitor) 23 are used. That simplifies the implementation at theexpense of reduced speed of dynamic response of the regulator. Thedigital logic 25 combines the functions described above.

In another embodiment of the present disclosure (FIG. 9, FIG. 9A), theLEDs comparator 16, as soon as it detects the transition of the Iscurrent over reference Iset, sends the signal (high) to the digitallogic 25;

the digital logic 25 starts Iset timer (not shown separately fromdigital logic 25) and keeps power switch 8 off;

power switch 8 is off and Iset timer is counting time Tt until LEDcurrent comparator 16 detects Is transition below Iset level by sendinga signal (low) to the digital logic 25; and

the digital logic stops Iset timer, reads its content and divides it byoff time to define new Ton time as Ton_(i+1)=Ton_(i)−Δton((Tt/Toff)−1).

We call the described process as asymmetrical hysteretic algorithm ofadjusting on time T_(on), the purpose of which is to improve the dynamicresponse of the regulator and limit the ripple of LED current.Asymmetrical hysteretic algorithms include two LED comparators (notshown) each set slightly apart to form a window for current ripple andotherwise working independently and similar to the above-describedprocess.

FIG. 10 is a sliding mode regulator 6 with the limited maximum on timeT_(on) max or maximum peak current in the inductor. This limit isachieved by adding an Ip peak current comparator 19 to the regulator 6,described in FIG. 9B. Ip comparator is connected with its negativeterminal to Ip current sense and it positive terminal to the Ipsetreference. The output of comparator 19 is sampled by the digital logic25 each switching cycle.

The above-presented sliding mode regulator 6 will be stable in thediscontinuous mode of operation. Another embodiment of the presentdisclosure in FIG. 11 is a digital PI or PID regulator capable to driveone or a plurality of LEDs with the continuous current in the switchingconverter FIG. 3. In the embodiment of FIG. 11, average LED current Isis filtered by a passive R-C network 22, 23. An LED current comparator24 is connected with its negative terminal to 24 a (Is current filter22, 23), and with its positive terminal to the output of a rampgenerator 28. A current set comparator 31 is connected to said rampgenerator 28 by its positive terminal. The negative terminal of thecomparator 31 is connected to a set current reference signal Iset 31 a.Outputs of both comparators 24 and 31 are connected to the digital logic26. The digital logic 26 controls a ramp generator 28, which generates aperiodical ramp signal 28 b (as shown in FIG. 12) with the minimum rampsignal selected to meet requirements of a maximum negative error andmaximum ramp signal selected to meet the requirements of a maximumpositive error. For example, assuming that at the nominal LEDs currentIs signal 24 a (as shown in FIG. 12) is 200 mV and maximum negative andpositive errors are 25%, then the ramp signal 28 b can be at least 150mV to 250 mV. The time base of this ramp signal is defined by a desiredresolution. Selecting, for example, a +/−6 bit resolution will give usat clock frequency 100 MHZ of the oscillator 30 the base time10×2×64=1280 nS or frequency of 78 kHZ, which is about the frequency oftypical LED drivers, meaning that the error generation may have at mostone cycle delay. The accuracy of the error generation per given examplewill be 50×100/200×64=0.39%. Those skilled in the art may design theramp generator per their specific requirements, using fundamentalguidelines of this specification.

As ramp generator 28 starts the ramp, both comparators 24 and 31 are inthe same state, low or high. Example of FIG. 12 assumes low. At somemoment of the ramp, both comparators 24 and 31 will change the state,going high. We call signals generated by the comparator 24 first and bythe comparator 31 second. Digital logic 26 samples the comparators 24and 31 at every clock of oscillator 30 and reads both first and secondsignals. Whichever signal comes first starts a time counter of an errorgenerator 29. Whichever signal comes last stops the time counter. Thedigital logic 26 assigns a sign to generated error positive if saidfirst signal comes last and negative if said second signal comes last.The digital logic 26 controls the frequency of the ramp generator 28 andgenerates an error signal once per cycle of ramp generator frequency.The implementation of digital error estimation was illustrated usingrelatively simple functional blocks without A/D converters. Thisimplementation does not necessarily need to have the functional blocksdescribed above. Different architectures may be used to make a non DSPdigital error estimation by using the following steps according to theprovided embodiment of the present disclosure:

(a) measuring off time ampseconds of said inductor or directly averageLED current;

(b) generating a periodical ramp signal at a constant frequency,generally smaller than switching frequency of said power converter,wherein said ramp signal is equal, generally at the middle of the rampto LEDs current set reference signal;

(c) comparing once per a cycle of said ramp frequency said ampsecondssignal with said ramp signal and generating a first signal at theinstance when said ramp signal starts exceeding said ampseconds signal;

(d) comparing once per a cycle of said ramp frequency said set referencesignal with said ramp signal and generating a second signal at theinstance when said ramp signal starts exceeding said set referencesignal;

(e) starting an error time counter by said first signal or by saidsecond signal whichever comes first;

(f) stopping said error time counter by said first signal or by saidsecond signal whichever comes last;

(g) reading said error time counter as a digital error and assigning asign to said error positive if said first signal comes last and negativeif said second signal comes last; and

(h) resetting all registers and start new cycle of error estimation.

Digital logic 26 is using the generated error to process it in a digitalPI or PID regulator (not shown separately) with desired stability gainsof proportional and integrated/differential parts. The output of thePI/PID regulator may generate in digital form either on time Ton forkeeping the switch 8 closed (FIG. 11A), or an Ipset level, which isshown in FIG. 11. A D/A converter 27 translates digital form of Ipsetinto analog which is used by comparator 19 and buffer 20 to drive theswitch 8 by regulating its peak current. A PI/PID regulator insidedigital logic can be designed with compensation to comply withcontinuous current performance at any duty cycle with practical limitsfrom 0 to 1.

The design of such compensation can be a routine task. The PIDcontroller has the transfer function:

${{Gc}(s)} = {K_{1} + \frac{K_{2}}{s} + {K_{3}s}}$

where:

s=complex variable of Laplace transform,

Gc(s)=compensator,

K₁=proportional gain coefficient,

K₂=differential coefficient, and

K₃=Integral coefficient.

The PID controller has a robust performance and a simplicity that allowsfor digital implementation to be very straight forward.The Z domain transfer function of a PID controller is:

${{Gc}(z)} = {K_{1} + \frac{K_{2}{Tz}}{( {z - 1} )} + {K_{3}\frac{( {z - 1} )}{Tz}}}$

where:

z=complex variable of Z transform,

Gc(z)=compensator,

K₁=proportional gain coefficient,

K₂=differential coefficient, and

K₃=integral coefficient.

The differential equation algorithm that provides a PID controller isobtained by adding three terms

u(k)=[K ₁ +K ₂ T+(K ₃ /T]x(k)+K ₃ Tx(k−1)+K ₂ u(k−1)

where:

u(k)=the control variable, this signal is used to add or subtract tocontrol pulse,

x(k)=current error sample,

x(k−1)=previous error sample,

T=sampling period,

K₁=proportional Gain coefficient,

K₂=differential coefficient, and

K₃=integral coefficient.

This is a useful control function to create a PI or PID controllersimply by setting the appropriate gain to zero. The ramp function willdetermine a digital value that will serve as the x(k) value in a givencontrol loop. By adjusting gain and delay, precise digital control canbe obtained over a variety of systems.

The system 1 for driving LED in FIG. 13 includes a protection circuitagainst a short circuit of a single or multiple LEDs, according toanother embodiment of the disclosure. The protection circuit comprises acomparator 32, connected to the input 37 and output 38 voltages of thesystem 1, an AND gate 33, having signals from the regulator 6 andcomparator 32, a buffer 34 and a switch 35. At the start of the system1, input voltage 37 is higher than the output 38, and comparator 32 islow, keeping switch 35 open. When the output capacitor 36 is chargedabove the input voltage 37, the comparator 32 changes its output tohigh. Assuming that the enable signal from the regulator 6 is also high,the buffer 34 will keep the switch 35 closed until a short circuit onthe output discharges the output voltage 38 below the input voltage 37.The comparator 32 output goes low, opens the switch 35 and disconnectsbattery 2 from discharging into low impedance.

The protection circuit 32-38 provides adequate current protection to theinput battery of the system, however it may overstress the isolationswitch 35 at the time capacitor 36 is discharging into low impedance.The circuit in FIG. 14 has an additional comparator 39 to detect theoverload or short circuit. At short circuit or overload the comparator39 instantly goes high (a small filter against noise is not shown). Theoutput signal of the comparator 39 goes to the regulator 6 which in turnshuts down the converter 3 and switches its enable signal at the ANDgate 33 from high to low, opening the switch 35. The regulator 6 may bedesigned with a few options:

-   -   to latch off the system until it is recycled by input voltage;    -   automatically restart the system after a specific delay of time;        and    -   toggle the switch 35 off and on until the output capacitor 36 is        discharged (in this case the comparator 32 will prevent the        discharging the battery into a small impedance if abnormal        situations at the output persists).

Open circuits are one of the common failures of an LED. At this failurean overvoltage is developing very quickly, potentially dangerous to allcomponents of the system. FIG. 14 illustrates another embodiment of thedisclosure related to overvoltage protection. If output voltage goeshigher than breakdown voltage of a zener diode 41, the excessive voltageappears on the sense terminal of the comparator 39, changing its stateto high and triggering protection functions described above.

If regulator 6 gets a signal from the application system to shut downthe system 1, it is an advantage of such a system to isolate the battery2 from driving circuits to save its power. It is a function of anotherembodiment of the disclosure implemented by a signal of regulator 6 atthe AND gate 33. When the signal from the regulator 6 goes low, theswitch 35 is open and the battery 2 is disconnected from drivingcircuits and load.

FIG. 15 illustrates a block diagram of R-G-B LEDs connected in threestrings 43, 44, 47 with each string having an independent currentregulator 45, 46, 48. Such connections of LEDs are typical practice incolor mixing systems. In this case it is desirable that the powerconverter 3 is configured to drive one or multiple strings of LEDs withthe regulated voltage source with a feedback signal Vs from voltagesensor 11, 12. We described above the method and system for driving asingle or a plurality of LEDs, regulating average current through LEDs.All referenced embodiments of the disclosure were illustrated by usingcurrent as a variable system parameter to regulate. By a principle ofduality of electrical circuits controlling current through components,connected in series and voltage across components connected in parallel,we can use similar systems and methods to drive one or multiple stringsof LEDs by controlling voltage across strings of LEDs with somespecifics of voltage regulation. For example, in case of voltageregulation, the integrator 14 (FIG. 5) will measure LEDs 43, 44, 47voltseconds (FIG. 15) by integrating the output voltage for a length ofthe cycle T and the comparator 16 will have voltage set signal at thenegative terminal. All other arrangements of the system will remain thesame as described above. Thus, in another embodiment of the disclosurethe proposed system will work as a voltage boost or buck-boost converterif input of the regulator 6 is switched to the voltage feedback Vs. Vsis connected to a resistive divider 11, 12. Signal Vs may also representan output of a light sensing device, then the driver will control lightbrightness rather than the LED average voltage.

Although the present disclosure has been described above with respect toseveral embodiments, various modifications can be made within the scopeof disclosure. The various circuits described in FIGS. 5, 8, 9, 9B, 10,11, and 13-15 are merely representative, and the circuitry and modulesmay be implemented in various manners using various technologies,digital or analog. Accordingly, the disclosure of the present disclosureis intended to be illustrative, but not limiting, of the scope of theclaimed subject matter.

The embodiments of the invention in which an exclusive property orprivilege is claimed are defined as follows:
 1. An integratedcontroller, comprising: a filter configured to provide an output currentsignal; a ramp generator configured to generate a reference ramp signal;a first comparator coupled to the filter and to the ramp generator,wherein the first comparator is configured to compare the output currentsignal to the reference ramp signal and provide a first signal; a secondcomparator coupled to the ramp generator, wherein the second comparatoris configured to compare an output current set signal to the referenceramp signal and provide a second signal; an error generator configuredto provide an error signal based on a timing count between generation ofthe first and second signals; a regulator configured to use the errorsignal to provide a control signal to control a dual phase cycle of apower converter at a constant frequency; and a third comparatorconfigured to compare the control signal with a sensed peak currentlevel and to turn off a power switch when the sensed peak current levelexceeds the control signal.
 2. The integrated controller of claim 1,further comprising: an output current sensor configured to sense anoutput current level.
 3. The integrated controller of claim 1, furthercomprising: a digital-to-analog converter coupled to the regulator andto the third comparator, wherein the digital-to-analog converter isconfigured to provide the control signal to the third comparator as ananalog control voltage.
 4. The integrated controller of claim 1, furthercomprising: a buffer coupled to the third comparator and configured todrive the power switch.
 5. The integrated controller of claim 1, furthercomprising: an output voltage sensor configured to sense an outputvoltage level.
 6. The integrated controller of claim 1, wherein thefilter comprises an RC circuit.
 7. The integrated controller of claim 1,wherein the reference ramp signal has a constant frequency.
 8. A methodof controlling a switching power converter for supplying power to one ormore light emitting diodes (“LEDs”), the method comprising: turning apower switch on to provide current through an inductor and the powerswitch; measuring ampseconds of the inductor at an off time; generatinga periodical ramp signal at a constant frequency; comparing the measuredampseconds with the periodical ramp signal and generating a first signalwhen the periodical ramp signal exceeds the measured ampseconds;comparing a set reference signal with the periodical ramp signal andgenerating a second signal when the periodical ramp signal exceeds theset reference signal; generating a signed digital error based on adifference between when the first signal or the second signal isgenerated; using the signed digital error, generating a digital controlsignal; converting the digital control signal into an analog peakcurrent reference signal; sensing a peak current through the powerswitch; comparing the peak current to the peak current reference signal;and turning the power switch off.
 9. The method of claim 8, furthercomprising: regulating LED brightness by sensing an optical output ofthe LED; generating an optical output signal; and adjusting the setreference signal to maintain the optical output signal substantiallyconstant.
 10. The method of claim 8, further comprising: regulatingcontrast of an illuminated area by sensing optical ambient; generatingan optical ambient signal; and adjusting the set reference signalproportionally to the optical ambient signal.
 11. The method of claim 8,further comprising: regulating LED brightness over thermal effects bysensing an LED junction temperature; generating a temperature signal;and adjusting the reference signal using a look-up table comprisingemission versus LED temperature performance.
 12. The method of claim 8,wherein the period of the ramp signal is greater than a time periodstarting when the switch is turned on and ending when the switch isturned off.
 13. A method of controlling a switching power converter forsupplying power to one or more light emitting diodes (“LEDs”), themethod comprising: turning a power switch on to provide current throughan inductor and the power switch; measuring voltseconds of the inductorat an off time; generating a periodical ramp signal at a constantfrequency; comparing the measured voltseconds with the periodical rampsignal and generating a first signal when the periodical ramp signalexceeds the measured voltseconds; comparing a set reference signal withthe periodical ramp signal and generating a second signal when theperiodical ramp signal exceeds the set reference signal; generating asigned digital error based on a difference between when the first signalor the second signal is generated; using the signed digital error,generating a digital control signal; converting the digital controlsignal into an analog peak current reference signal; sensing a peakcurrent through the power switch; comparing the peak current to the peakcurrent reference signal; and turning the power switch off.
 14. Themethod of claim 13, further comprising: regulating LED brightness bysensing an optical output of the LED; generating an optical outputsignal; and adjusting the set reference signal to maintain the opticaloutput signal substantially constant.
 15. The method of claim 13,further comprising: regulating contrast of an illuminated area bysensing optical ambient; generating an optical ambient signal; andadjusting the set reference signal proportionally to the optical ambientsignal.
 16. The method of claim 13, further comprising: regulating LEDbrightness over thermal effects by sensing an LED junction temperature;generating a temperature signal; and adjusting the reference signalusing a look-up table comprising emission versus LED temperatureperformance.
 17. The method of claim 13, wherein the period of the rampsignal is greater than a time period starting when the switch is turnedon and ending when the switch is turned off.